Last Update: 2025/3/26
LLMVision Clone Voice API
Endpoint
POST https://platform.llmprovider.ai/v1/audio/clone
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | multipart/form-data |
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
input | string | Yes | The text content to generate audio from. |
prompt | string | Yes | The reference text for the audio sample, used to guide the model's style or continue a previous audio segment. |
model | string | Yes | The ID of the model to use, e.g., whisper-1 . |
file | file | No | The sample audio file in one of the following formats: flac , mp3 , mp4 , mpeg , mpga , m4a , ogg , wav , or webm . |
response_format | string | No | The output format of the transcript. Options: json , text , srt , verbose_json , or vtt . Default is json . |
stream | boolean | No | Whether to enable streaming. Default is false . |
audio_base64 | string | No | The Base64-encoded audio file content. |
duration | int64 | No | The duration of the audio file (in seconds). This is used internally and is not a request parameter. |
Additional Notes:
- Either
file
oraudio_base64
must be provided, but not both. - When
stream
is set totrue
, the server will return audio data in a streaming format, suitable for real-time applications. - The
prompt
parameter can provide stylistic guidance, influencing the generated audio output.
Response Body
The transcription object
or a verbose transcription object
.
Example Request
{
"model": "lmp-clone-20250310",
"input": "收到好友从远方寄来的生日礼物,那份意外的惊喜与深深的祝福让我心中充满了甜蜜的快乐,笑容如花儿般笼放。",
"prompt": "我觉得最近北京的天气真的是哈,比较难难以预料吧,就昨天我们在马上就要结束的时候,突然就开始下大雨。",
"file": "./参考音频.wav"
}
Response
The API returns an audio file in the requested format.
Example Request
- Shell
- nodejs
- python
curl -X POST https://platform.llmprovider.ai/v1/audio/clone \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F file="@audio.mp3" \
-F model="lmp-clone-20250310"
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const formData = new FormData();
formData.append('file', fs.createReadStream('audio.mp3'));
formData.append('model', 'lmp-clone-20250310');
axios.post('https://platform.llmprovider.ai/v1/audio/clone', formData, {
headers: {
'Authorization': `Bearer ${YOUR_API_KEY}`,
...formData.getHeaders()
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
import requests
audio_file = open("audio.mp3", "rb")
files = {
"file": audio_file
}
headers = {
"Authorization": f"Bearer {YOUR_API_KEY}"
}
response = requests.post(
"https://platform.llmprovider.ai/v1/audio/clone",
headers=headers,
files=files,
data={
"model": "lmp-clone-20250310"
}
)
print(response.json())
For any questions or further assistance, please contact us at [email protected].